package cn.stylefeng.guns.sys.core.alipay;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @Author : xiaofei
 * @Date: 2019/6/19
 */
public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016092900620445";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCEPZMDX60JbaZahvGuFBXc/txogI6DilSSp+UUyjfLtq5/ry5rRq1bPvoIW4NGlNuEa7n2FqHvbyF7kJQVxY61icn1W+A5wtxEPG2202HJMVPojyCoSmKeKMWr0zLHcNzUwwsjNIlQ0B8o1ttC1m1ALBzZfLjVKDzIVWq93hiWkLV069SSxQWFXuQa9j0HRMXHDUfF0Bj0n9l/dFdnieBwdjpKQjOyismCGZr29sQrPI8V6ZavaPhLuGZPsN5mLsWcP5WwZEUhQOpHm/y8+e6HAksC0lUUvU1wUsjDgUMfMEpa5Q0YKqIdk0pLOgH8r53VtWKvE7EHaqYqPw4fEycJAgMBAAECggEACIXvc8g23uSyVCNecFnbDuNeUV330YKY8NrhaPWfowGjPZeM5l0nzzm/48oCLApsG5zV34aV6VjAT7aB1OVmzUyUN7w0N4TXrY43hBEbvFvxjIutDyu8L3VxSCHUpAYiNZRco2g/cXX4jClM+IHZiMlPErV3NEXjpQXcW2B1NT8Ga2nYfc5OeWufResYuj1TilC9LlgM1TCZBZIl31FoEZisLpusycvTvwzffkHAZcS8dQiaaEuDkyLmZVgSnQoi9MZ678RifwVvMcat5K4ac+k7jVtoAYa8d+LV1wTbZMixmphaNl9P4+GXnjbvm2usJoE2E6+PwHljBjYeUJ+IAQKBgQDYV90s7wbphB85fFlr7U01mIaWQAol7/HKJ2hs4CSnxBrjDdWP98YF7KX2aEi2kNLAVoCbc7rAOGz5El3wQwetWOz88cNvup/EdNTSN4e2selhY/Rp+Fdg/7opErcjc9nSiLx7B5q7nG9UpG9A8qPp9mRWwcLEE9t8fFciOe0ADQKBgQCcexoN9rl8gZtCxMWgSw4ANBXBF+Fko92u+Fbb5QPN0xmJOBHEXiAQgBSzZeCPFjkwGFDF2Gme8e66UM+J8t1l55lm6VYHnmQqPB51eBzv8+d9lbfGcscDy8o3VfWdJUWYl1+NSyLqMJDWogf6G8lN7BUh7unt6z9vhZghyiDH7QKBgQDOWB+Qt/rzxxyxC7WOhyvZLr1PmY0UWiNYGPY0wiS0DwtF/O/w/PZWuDwjJZwU5VTeNqM7ocpBhJALkEUg4A32fJatOzqY2nuAOZ6zUluTGWXrihaY7FELJ147xqn+moTrlZeQENS4lKBrLtseK0/D20ogpXZK5lW2CjJhZrZyEQKBgBSq7bYKcFVRiQA4nSGeyCqetoDadpqkShNiGZbRmL8Gssi87xvQksubHyDSw+YiOUtw6ro26zxjF/Tj14WQ3k0nWcuN5h77fJ9XcW5yft/yhxC/RZagcki+EeddIyOuWJLe62/uDJ6B659tp0ARi3UPSXtB4wPZnndMXduYptvBAoGAKgAUqeRDja1/NZyt0J9zJqMEJvEDRWqTWAy55CWxxwZx4jnC8jZ8rXhpDonteNNgVoUU6BCR8STua/BQIsUQmsfaXslIIwwFLUxJpSZXWAHkC3LyiB5E6fuSEfoFMfeo5Cg77LTEdNACySKn9Qid8+3oi/35ivTCogRlWsnwK8A=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3mkWuXN/gluoGvaBqFDDXe1WXVQAmwRvHbLHIzR/A51g9m+W6geNgkEju83BjBrtds9nPklIAVqdxI8SoXa4rRyaqeKfczJ1fbbLaOC/DH+djVZ9hJg9Jm2Bh1pY7A7TMc5lJjHW5pG3oncDWjMpkf4WiRxIaNJRpCIYNdfZl63hI3Noxzzfxe4Jq8QhQYNkp7OEftr50noGonheR0bwY9VcYoMZog4FBluxA36OY+8qXd6XngjWDi2Ct+6Zo0deQ4cADJRcXJ/GlTKnVzc+DPutxrrUsO9NVwlX4No2roRSk3HYCG9Qn5AfaTCg3J1TfouXwv/FCo7SqRtnBRx1LQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://baidu.com";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://baidu.com";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }



}
